<template>
  <div>
    <!-- <singleLineChart :singleLineDataSource="gcbdStc"></singleLineChart> -->
    <Pie :PieDataSource="devStc"></Pie>
    <LineChart :LineDataSource="alarmStc"></LineChart>
  </div>
</template>

<script>
import Pie from "./../../components/Echart/pie.vue";
import LineChart from "./../../components/Echart/line.vue";
// import singleLineChart from "./../../components/Echart/singleLine.vue";
import { getChartStatistic } from "./../../api/echart";
export default {
  components: {
    // singleLineChart,
    LineChart,
    Pie
  },
  data() {
    return {
      // gcbdStc: {
      //   areaCount: 1,
      //   bdCount: 1,
      //   gcCount: 1
      // },
      alarmStc: {
          offLine: 0,
          offLineHis: 0,
          fireAlarm: 15,
          fireAlarmHis: 25,
          errorAlarm: 254,
          errorAlarmHis: 258,
          integralAlarm: 0,
          integralAlarmHis: 0,
          powerAlarm: 0,
          powerAlarmHis: 0
      },
      devStc: { bindDev: 1, offlineDev: 1, onlineDev: 1, unbindDev: 1 }
    };
  },
  computed: {},
  watch: {},
  created() {
    this.initData();
  },
  mounted() {},
  activated() {},

  deactivated() {},

  methods: {
    async initData() {
      let res = await getChartStatistic({});
      if (res.code == 0) {
        // this.gcbdStc = res.data.gcbdStc;
        this.devStc = res.data.devStc;
        console.log(res.data.alarmStc)
        this.alarmStc = res.data.alarmStc;
      } else {
        this.$toast.fail(res.msg);
      }
    }
  }
};
</script>


<style lang="scss" scoped>
@import "./../../../../assets/scss/mixin";
</style>
